package com.getpebble.android.main.sections.notifications.adapter;

import android.content.Context;
import android.database.Cursor;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CursorAdapter;
import com.getpebble.android.common.model.PblAndroidAppModel;

public class AndroidAppAdapter extends CursorAdapter {
    public AndroidAppAdapter(Context context, Cursor c) {
        super(context, c, 0);
    }

    public View newView(Context context, Cursor cursor, ViewGroup parent) {
        return new AndroidAppView(context);
    }

    public void bindView(View view, Context context, Cursor cursor) {
        if (view instanceof AndroidAppView) {
            ((AndroidAppView) view).setModel(PblAndroidAppModel.getRecordFromCursor(cursor));
        }
    }
}
